package com.vca.common.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author Li
 * @date 2022/11/22   9:22
 */
@Data
public class ProductTypeRequest implements Serializable {

    private static final long serialVersionUID = -8735180522267090832L;

    @ApiModelProperty(value = "主键id")
    private Integer id;

    @ApiModelProperty(value = "分类名称")
    @NotBlank(message = "分类名称必须填写")
    @Length(max = 50, message = "分类名称不能超过50个字符")
    private String name;

    @ApiModelProperty(value = "分类英文名称")
    @NotBlank(message = "分类英文名称必须填写")
    @Length(max = 100, message = "分类英文名称不能超过50个字符")
    private String nameEn;

    @ApiModelProperty(value = "父id")
    private Integer pid;

    @ApiModelProperty(value = "标签颜色")
    private String labelColor;

    @ApiModelProperty(value = "状态, 0正常，1失效")
    @NotNull(message = "状态必须选择")
    private Boolean status;

    @ApiModelProperty(value = "排序")
    @NotNull(message = "排序数字为空")  //不可为空
    @Min(value = 0, message = "排序数字必须大于等于0") //数字最小值为0
    private Integer sort;
}
